/**
 * 
 */
package com.topline.xiaocaifeng;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.ExitCodeGenerator;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.test.context.ActiveProfiles;

/**
 * @author xuefei
 *
 */
@SpringBootApplication
@ActiveProfiles("topline-1")
public class SpringBootMongoApp implements CommandLineRunner,ApplicationRunner /*extends TestEnableAutoConfiguration*/ /*implements EmbeddedServletContainerCustomizer*/{

	@Autowired
	MongoOperations mongoOperations;
	
    @Override
    public void run(String... args) throws Exception {
        // TODO Auto-generated method stub
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        // TODO Auto-generated method stub
    }
    @Bean
    public ExitCodeGenerator exitCodeGenerator() {
        return new ExitCodeGenerator() {
            @Override
            public int getExitCode() {
                return 42;
            }
        };
    }
	public static void main(String[] args) {
	    SpringApplication.run(SpringBootMongoApp.class, args);
	    /*System.out.println(SpringApplication
                .exit(SpringApplication.run(SpringBootMongoApp.class, args)));*/
	}

	



	/*@Override
	public void customize(ConfigurableEmbeddedServletContainer container) {
		// TODO Auto-generated method stub
		container.setPort(8090);
	}*/
	
	/*@Bean
	public EmbeddedServletContainerFactory servletContainerFactory(){
		TomcatEmbeddedServletContainerFactory containerFactory = new TomcatEmbeddedServletContainerFactory();
		containerFactory.setPort(8091);
		return containerFactory;
	}*/
}
